using System;
using System.Collections.Generic;
using System.Text;

namespace Hermes.Framework.Implementation.Directory
{
    class TxDirectoryCreate : TxOperationTemplate, ITransactableCreate
    {
        public TxDirectoryCreate(string directoryName)
            : base(directoryName)
        {

        }

        #region ITransactableCreate
        public void Create()
        {
            base.Execute(base.dstFileName);
        }
        #endregion

        protected override void Operate()
        {
            this.fileSystem.CreateDirectory(this.dstFileName);
        }

        public override void Commit()
        {
            
        }

        public override void Rollback()
        {            
            this.fileSystem.RemoveDirectory(this.dstFileName);
            Console.WriteLine("Directory {0} removed.", this.dstFileName);
        }
    }
}
